﻿namespace LogCenterService.Models;

public class Response
{
    public bool Success { get; set; } = true;
    public object Data { get; set; }
    public string Message { get; set; } = string.Empty;

    public static Response Ok()
    {
        return new Response();
    }

    public static Response Ok(string message = null, object data = null)
    {
        return new Response
        {
            Success = true,
            Message = message ?? "成功",
            Data = data
        };
    }

    public static Response Error(string message = null, object data = null)
    {
        return new Response
        {
            Success = false,
            Message = message ?? "失败",
            Data = data
        };
    }
}